import { HttpStatus, Injectable } from '@nestjs/common';

@Injectable()
export class ApiResponse {
  static success<T>(
    data: T,
    message = 'Success',
  ): { statusCode: number; message: string; data: T } {
    return {
      statusCode: HttpStatus.OK,
      message,
      data,
    };
  }

  static error(
    statusCode: number,
    message: string,
    error?: any,
  ): { statusCode: number; message: string; error?: any } {
    return {
      statusCode,
      message,
      error,
    };
  }
}
